
 <!DOCTYPE HTML>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  
    <title>Jark&#39;s Blog</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
    
    <meta name="author" content="WuChong">
    
    <meta name="description" content="伍翀的个人技术博客">
    
    
    <meta name="description" content="伍翀的个人技术博客">
<meta property="og:type" content="website">
<meta property="og:title" content="Jark's Blog">
<meta property="og:url" content="http://wuchong.me/page/6/">
<meta property="og:site_name" content="Jark's Blog">
<meta property="og:description" content="伍翀的个人技术博客">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Jark's Blog">
<meta name="twitter:description" content="伍翀的个人技术博客">
<meta name="twitter:creator" content="@jarkwu">
<link rel="publisher" href="111190881341800841449">

    
    <link rel="alternative" href="/atom.xml" title="Jark&#39;s Blog" type="application/atom+xml">
    
    
    <link rel="icon" href="/img/favicon.ico">
    
    
    <link rel="apple-touch-icon" href="/img/jacman.jpg">
    <link rel="apple-touch-icon-precomposed" href="/img/jacman.jpg">
    
    <link rel="stylesheet" href="/css/style.css" type="text/css">
</head>

  <body>
    <header>
      <div>
		
			<div id="imglogo">
				<a href="/"><img src="/img/logo.png" alt="Jark&#39;s Blog" title="Jark&#39;s Blog"/></a>
			</div>
			
			<div id="textlogo">
				<h1 class="site-name"><a href="/" title="Jark&#39;s Blog">Jark&#39;s Blog</a></h1>
				<h2 class="blog-motto">当你的才华还撑不起你的野心时，你就应该静下心来学习。</h2>
			</div>
			<div class="navbar"><a class="navbutton navmobile" href="#" title="菜单">
			</a></div>
			<nav class="animated">
				<ul>
					<ul>
					 
						<li><a href="/">首页</a></li>
					
						<li><a href="/archives">归档</a></li>
					
						<li><a href="/about">关于</a></li>
					
					<li>
 					
						<form class="search" action="http://zhannei.baidu.com/cse/search" target="_blank">
							<label>Search</label>
						<input name="s" type="hidden" value= 783281470518440642 ><input type="text" name="q" size="30" placeholder="搜索"><br>
						</form>
					
					</li>
				</ul>
			</nav>			
</div>
    </header>
    <div id="container">
      <div id="main">

   
    
    <article class="post-expand post" itemprop="articleBody"> 
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/blog/2014/03/25/interview-link-questions/" title="面试精选：链表问题集锦" itemprop="url">面试精选：链表问题集锦</a>
  </h1>
  <p class="article-author">By
       
		<a href="https://plus.google.com/111190881341800841449?rel=author" title="WuChong" target="_blank" itemprop="author">WuChong</a>
		
  <p class="article-time">
    <time datetime="2014-03-25T14:58:06.000Z" itemprop="datePublished"> 发表于 2014-03-25</time>
    
  </p>
</header>
    <div class="article-content">
        
        <p>链表问题在面试过程中也是很重要也很基础的一部分，链表本身很灵活，很考查编程功底，所以是很值得考的地方。我将复习过程中觉得比较好的链表问题整理了下。</p>
<p>下面是本文所要用到链表节点的定义：</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre>1
2
3
4
</pre></td><td class="code"><pre><span class="keyword">struct</span> Node{
    <span class="keyword">int</span> data;
    Node* next;
};
</pre></td></tr></table></figure>

<h2 id="1-_在O(1)时间删除链表节点">1. 在O(1)时间删除链表节点</h2>
<p><strong>题目描述：</strong>给定链表的头指针和一个节点指针，在O(1)时间删除该节点。[Google面试题]</p>
<p><strong>分析：</strong>本题与《编程之美》上的「从无头单链表中删除节点」类似。主要思想都是「狸猫换太子」，即用下一个节点数据覆盖要删除的节点，然后删除下一个节点。但是如果节点是尾节点时，该方法就行不通了。</p>
<p>代码如下：</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre><span class="comment">//O(1)时间删除链表节点，从无头单链表中删除节点</span>
<span class="keyword">void</span> deleteRandomNode(Node *cur)
{
    assert(cur != NULL);
    assert(cur-&gt;next != NULL);    <span class="comment">//不能是尾节点</span>
    Node* pNext = cur-&gt;next;
    cur-&gt;data = pNext-&gt;data;
    cur-&gt;next = pNext-&gt;next;
    <span class="keyword">delete</span> pNext;
}
</pre></td></tr></table></figure><br>
        
        
        <p class="article-more-link">
          
            <a href="/blog/2014/03/25/interview-link-questions/#more">阅读更多</a>
          
       </p>
    </div>
    <footer class="article-footer clearfix">
<div class="article-catetags">

<div class="article-categories">
  <span></span>
  <a class="article-category-link" href="/categories/程序设计/">程序设计</a>
</div>


  <div class="article-tags">
  
  <span></span> <a href="/tags/面试/">面试</a><a href="/tags/算法/">算法</a>
  </div>

</div>




<div class="comments-count">
	
	  	<span></span>
		<a href="http://wuchong.me/blog/2014/03/25/interview-link-questions/#comments" class="ds-thread-count comments-count-link" data-thread-key="blog/2014/03/25/interview-link-questions/" data-count-type="comments">&nbsp;</a>
	
</div>

</footer>


    </article>






   
    
    <article class="post-expand post" itemprop="articleBody"> 
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/blog/2014/03/17/string-to-int/" title="字符串转换成整数——从源码学习" itemprop="url">字符串转换成整数——从源码学习</a>
  </h1>
  <p class="article-author">By
       
		<a href="https://plus.google.com/111190881341800841449?rel=author" title="WuChong" target="_blank" itemprop="author">WuChong</a>
		
  <p class="article-time">
    <time datetime="2014-03-17T15:24:28.000Z" itemprop="datePublished"> 发表于 2014-03-17</time>
    
  </p>
</header>
    <div class="article-content">
        
        <p>字符串转换成整数：输入一个表示整数的字符串，把该字符串转换成整数并输出，例如输入字符串”345”，则输出整数345。</p>
<p>在笔试面试中，atoi 即「字符串转换成整数」是一个经典问题了，此题无关算法，考察的更多是编码能力和细节考虑能力。因此自己就动手写了下，写完之后，打开 JDK 的源码想看看大牛是怎么写的，所谓「站在巨人的肩膀上」，果然还是有很多有意思的东西的。 </p>
<p>首先，实现的思路是扫描整个字符串，扫描到当前字符时，将之前的结果乘以10加上当前字符代表的数字。</p>
<p>思路是很简单，但是有很多细节需要考虑，也是本题考查的重点。</p>
<ol>
<li>开头可能会有 ‘+’ 和 ‘-‘，表示整数的正负。</li>
<li>字符串为 null 或是空（””）呢？ </li>
<li>字符串中包含非数字的字符</li>
<li>只有一个 “+” 或 “-“ 字符呢？</li>
<li>最后就是溢出问题。<br>
        
        
        <p class="article-more-link">
          
            <a href="/blog/2014/03/17/string-to-int/#more">阅读更多</a>
          
       </p>
    </div>
    <footer class="article-footer clearfix">
<div class="article-catetags">

<div class="article-categories">
  <span></span>
  <a class="article-category-link" href="/categories/程序设计/">程序设计</a>
</div>


  <div class="article-tags">
  
  <span></span> <a href="/tags/面试/">面试</a><a href="/tags/源码/">源码</a><a href="/tags/Java/">Java</a>
  </div>

</div>




<div class="comments-count">
	
	  	<span></span>
		<a href="http://wuchong.me/blog/2014/03/17/string-to-int/#comments" class="ds-thread-count comments-count-link" data-thread-key="blog/2014/03/17/string-to-int/" data-count-type="comments">&nbsp;</a>
	
</div>

</footer>


    </article>






   
    
    <article class="post-expand post" itemprop="articleBody"> 
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/blog/2014/03/14/use-latex-in-blog/" title="在博客上写LaTex数学公式" itemprop="url">在博客上写LaTex数学公式</a>
  </h1>
  <p class="article-author">By
       
		<a href="https://plus.google.com/111190881341800841449?rel=author" title="WuChong" target="_blank" itemprop="author">WuChong</a>
		
  <p class="article-time">
    <time datetime="2014-03-14T15:12:03.000Z" itemprop="datePublished"> 发表于 2014-03-14</time>
    
  </p>
</header>
    <div class="article-content">
        
        <p>最近在学习研究一些算法，遇到很多数学公式。想到以前要在博客上写数学公式的时候，总是要在本地生成一张复杂公式的图片，再在博客上引用图片，这种方式显然满足不了「程序员」。遂折腾了一番。</p>
<p>下面推荐两种比较常用的方法。</p>
<h2 id="使用Google的绘图服务">使用Google的绘图服务</h2>
<p>Google Chart API 是一个非常强大的工具，通过 API 接口，会动态生成一张 png 图片，当然也支持 LaTex 语言。</p>
<p>API 调用方式如下</p>
<pre><code><span class="label">http:</span>//chart<span class="preprocessor">.apis</span><span class="preprocessor">.google</span><span class="preprocessor">.com</span>/chart?cht=tx&amp;chl=E=mc^<span class="number">2</span>
</code></pre><p>其中参数<code>cht</code>表示图表类型, <code>tx</code>表示图表类型为tex语言，<code>chl</code> 表示图表标注，<code>E=mc^2</code>就是质能守恒方程的 LaTex 语句。在 markdown 中就可以通过引用图片的方式加入进来。</p>
<pre><code><span class="tag">&lt;<span class="title">img</span> <span class="attribute">src</span>=<span class="value">"http://chart.apis.google.com/chart?cht=tx&amp;chl=E=mc^2"</span> /&gt;</span> 
</code></pre><p>
        
        
        <p class="article-more-link">
          
            <a href="/blog/2014/03/14/use-latex-in-blog/#more">阅读更多</a>
          
       </p>
    </div>
    <footer class="article-footer clearfix">
<div class="article-catetags">

<div class="article-categories">
  <span></span>
  <a class="article-category-link" href="/categories/Hexo/">Hexo</a>
</div>


  <div class="article-tags">
  
  <span></span> <a href="/tags/Hexo/">Hexo</a><a href="/tags/博客/">博客</a><a href="/tags/教程/">教程</a>
  </div>

</div>




<div class="comments-count">
	
	  	<span></span>
		<a href="http://wuchong.me/blog/2014/03/14/use-latex-in-blog/#comments" class="ds-thread-count comments-count-link" data-thread-key="blog/2014/03/14/use-latex-in-blog/" data-count-type="comments">&nbsp;</a>
	
</div>

</footer>


    </article>






   
    
    <article class="post-expand post" itemprop="articleBody"> 
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/blog/2014/02/25/jquery-datatable-sort-plugin/" title="jQuery.dataTables 自定义排序" itemprop="url">jQuery.dataTables 自定义排序</a>
  </h1>
  <p class="article-author">By
       
		<a href="https://plus.google.com/111190881341800841449?rel=author" title="WuChong" target="_blank" itemprop="author">WuChong</a>
		
  <p class="article-time">
    <time datetime="2014-02-25T14:33:30.000Z" itemprop="datePublished"> 发表于 2014-02-25</time>
    
  </p>
</header>
    <div class="article-content">
        
        <p>最近在项目中用到了 jQuery.dataTables， 这是一个很强大的 jQuery 插件，调用方便，支持回调对数据进行排序、查询、分页等操作，并且 bootstrap 框架也有对其封装，省了我们界面设计的活。dataTables 自带了string，date，numeric 的排序，但当遇到比较特殊的排序需求时，就得另寻出路了。</p>
<p>这几天正好碰到了这么个需求，一个统计表格中的有几列的单元格是百分数，而且还带有 html 的标签。需要针对这几列的百分数排序。</p>
<p>单元格中的 html 代码是这样的。</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre>1
2
</pre></td><td class="code"><pre><span class="tag">&lt;<span class="title">span</span> <span class="attribute">class</span>=<span class="value">"label label-important"</span>&gt;</span>
<span class="tag">&lt;<span class="title">i</span> <span class="attribute">class</span>=<span class="value">"icon-caret-up"</span>&gt;</span><span class="tag">&lt;/<span class="title">i</span>&gt;</span>&amp;nbsp;&amp;nbsp;100.0%<span class="tag">&lt;/<span class="title">span</span>&gt;</span>
</pre></td></tr></table></figure>

<p>表格大概是长这样的。</p>
<p><img src="/img/20140225-1.png" alt=""></p>
<p>而 dataTables 的自带排序会将这一列视为 string 排序。 显然是不满足我们需求的。一开始以为要大动干戈，后来看了API文档后发现，dataTables 的第三方扩展支持还是很灵活的。官方文档中提供了两种方法： (1) Type based column sorting ; (2) Custom data source sorting<br>。我使用的是第一种方法。主要思路就是将单元格内容转成可排序的 float 类型。<br>
        
        
        <p class="article-more-link">
          
            <a href="/blog/2014/02/25/jquery-datatable-sort-plugin/#more">阅读更多</a>
          
       </p>
    </div>
    <footer class="article-footer clearfix">
<div class="article-catetags">

<div class="article-categories">
  <span></span>
  <a class="article-category-link" href="/categories/编程语言/">编程语言</a>
</div>


  <div class="article-tags">
  
  <span></span> <a href="/tags/jQuery/">jQuery</a>
  </div>

</div>




<div class="comments-count">
	
	  	<span></span>
		<a href="http://wuchong.me/blog/2014/02/25/jquery-datatable-sort-plugin/#comments" class="ds-thread-count comments-count-link" data-thread-key="blog/2014/02/25/jquery-datatable-sort-plugin/" data-count-type="comments">&nbsp;</a>
	
</div>

</footer>


    </article>






   
    
    <article class="post-expand post" itemprop="articleBody"> 
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/blog/2014/02/09/algorithm-sort-summary/" title="经典排序算法总结与实现" itemprop="url">经典排序算法总结与实现</a>
  </h1>
  <p class="article-author">By
       
		<a href="https://plus.google.com/111190881341800841449?rel=author" title="WuChong" target="_blank" itemprop="author">WuChong</a>
		
  <p class="article-time">
    <time datetime="2014-02-09T15:48:26.000Z" itemprop="datePublished"> 发表于 2014-02-09</time>
    
  </p>
</header>
    <div class="article-content">
        
        <p>经典排序算法在面试中占有很大的比重，也是基础，为了未雨绸缪，在寒假里整理并用Python实现了七大经典排序算法，包括冒泡排序，插入排序，选择排序，希尔排序，归并排序，快速排序，堆排序。希望能帮助到有需要的同学。之所以用Python实现，主要是因为它更接近伪代码，能用更少的代码实现算法，更利于理解。</p>
<p>本篇博客所有排序实现均默认从小到大。</p>
<h2 id="一、冒泡排序_BubbleSort">一、冒泡排序 BubbleSort</h2>
<p><strong>介绍：</strong></p>
<p>冒泡排序的原理非常简单，它重复地走访过要排序的数列，一次比较两个元素，如果他们的顺序错误就把他们交换过来。  </p>
<p><strong>步骤：</strong></p>
<ol>
<li>比较相邻的元素。如果第一个比第二个大，就交换他们两个。</li>
<li>对第0个到第n-1个数据做同样的工作。这时，最大的数就“浮”到了数组最后的位置上。</li>
<li>针对所有的元素重复以上的步骤，除了最后一个。</li>
<li>持续每次对越来越少的元素重复上面的步骤，直到没有任何一对数字需要比较。</li>
</ol>
<p><strong>源代码：</strong>(python实现)</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre><span class="function"><span class="keyword">def</span> <span class="title">bubble_sort</span><span class="params">(arry)</span>:</span>
    n = len(arry)                   <span class="comment">#获得数组的长度</span>
    <span class="keyword">for</span> i <span class="keyword">in</span> range(n):
        <span class="keyword">for</span> j <span class="keyword">in</span> range(<span class="number">1</span>,n-i):
            <span class="keyword">if</span>  arry[j-<span class="number">1</span>] &gt; arry[j] :       <span class="comment">#如果前者比后者大</span>
                arry[j-<span class="number">1</span>],arry[j] = arry[j],arry[j-<span class="number">1</span>]      <span class="comment">#则交换两者</span>
    <span class="keyword">return</span> arry
</pre></td></tr></table></figure><br>
        
        
        <p class="article-more-link">
          
            <a href="/blog/2014/02/09/algorithm-sort-summary/#more">阅读更多</a>
          
       </p>
    </div>
    <footer class="article-footer clearfix">
<div class="article-catetags">

<div class="article-categories">
  <span></span>
  <a class="article-category-link" href="/categories/程序设计/">程序设计</a>
</div>


  <div class="article-tags">
  
  <span></span> <a href="/tags/算法/">算法</a><a href="/tags/Python/">Python</a><a href="/tags/面试/">面试</a>
  </div>

</div>




<div class="comments-count">
	
	  	<span></span>
		<a href="http://wuchong.me/blog/2014/02/09/algorithm-sort-summary/#comments" class="ds-thread-count comments-count-link" data-thread-key="blog/2014/02/09/algorithm-sort-summary/" data-count-type="comments">&nbsp;</a>
	
</div>

</footer>


    </article>







  <nav id="page-nav" class="clearfix">
    <a class="extend prev" rel="prev" href="/page/5/"><span></span>Prev</a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/4/">4</a><a class="page-number" href="/page/5/">5</a><span class="page-number current">6</span><a class="page-number" href="/page/7/">7</a><a class="page-number" href="/page/8/">8</a><a class="extend next" rel="next" href="/page/7/">Next<span></span></a>
  </nav>

</div>
      <div class="openaside"><a class="navbutton" href="#" title="显示侧边栏"></a></div>

<div id="asidepart">
<div class="closeaside"><a class="closebutton" href="#" title="隐藏侧边栏"></a></div>
<aside class="clearfix">

  
<div class="categorieslist">
	<p class="asidetitle">分类</p>
		<ul>
		
			<li><a href="/categories/Hexo/" title="Hexo">Hexo<sup>7</sup></a></li>
		
			<li><a href="/categories/LinuxUnix/" title="Linux/Unix">Linux/Unix<sup>6</sup></a></li>
		
			<li><a href="/categories/Python/" title="Python">Python<sup>3</sup></a></li>
		
			<li><a href="/categories/推荐系统/" title="推荐系统">推荐系统<sup>3</sup></a></li>
		
			<li><a href="/categories/杂项资源/" title="杂项资源">杂项资源<sup>2</sup></a></li>
		
			<li><a href="/categories/程序设计/" title="程序设计">程序设计<sup>5</sup></a></li>
		
			<li><a href="/categories/系统架构/" title="系统架构">系统架构<sup>1</sup></a></li>
		
			<li><a href="/categories/编程语言/" title="编程语言">编程语言<sup>2</sup></a></li>
		
			<li><a href="/categories/职场生涯/" title="职场生涯">职场生涯<sup>2</sup></a></li>
		
			<li><a href="/categories/随笔生活/" title="随笔生活">随笔生活<sup>5</sup></a></li>
		
		</ul>
</div>


  
<div class="tagslist">
	<p class="asidetitle">标签</p>
		<ul class="clearfix">
		
			<li><a href="/tags/Hexo/" title="Hexo">Hexo<sup>8</sup></a></li>
		
			<li><a href="/tags/面试/" title="面试">面试<sup>5</sup></a></li>
		
			<li><a href="/tags/Linux基础/" title="Linux基础">Linux基础<sup>5</sup></a></li>
		
			<li><a href="/tags/生活/" title="生活">生活<sup>4</sup></a></li>
		
			<li><a href="/tags/博客/" title="博客">博客<sup>4</sup></a></li>
		
			<li><a href="/tags/Python/" title="Python">Python<sup>4</sup></a></li>
		
			<li><a href="/tags/阿里推荐大赛/" title="阿里推荐大赛">阿里推荐大赛<sup>4</sup></a></li>
		
			<li><a href="/tags/算法/" title="算法">算法<sup>2</sup></a></li>
		
			<li><a href="/tags/爬虫/" title="爬虫">爬虫<sup>2</sup></a></li>
		
			<li><a href="/tags/ODPS/" title="ODPS">ODPS<sup>2</sup></a></li>
		
			<li><a href="/tags/教程/" title="教程">教程<sup>2</sup></a></li>
		
			<li><a href="/tags/Jacman/" title="Jacman">Jacman<sup>2</sup></a></li>
		
			<li><a href="/tags/Java/" title="Java">Java<sup>2</sup></a></li>
		
			<li><a href="/tags/文件系统/" title="文件系统">文件系统<sup>2</sup></a></li>
		
			<li><a href="/tags/启动流程/" title="启动流程">启动流程<sup>1</sup></a></li>
		
			<li><a href="/tags/权限/" title="权限">权限<sup>1</sup></a></li>
		
			<li><a href="/tags/正则表达式/" title="正则表达式">正则表达式<sup>1</sup></a></li>
		
			<li><a href="/tags/jQuery/" title="jQuery">jQuery<sup>1</sup></a></li>
		
			<li><a href="/tags/双检锁/" title="双检锁">双检锁<sup>1</sup></a></li>
		
			<li><a href="/tags/设计模式/" title="设计模式">设计模式<sup>1</sup></a></li>
		
		</ul>
</div>


  <div class="linkslist">
  <p class="asidetitle">友情链接</p>
    <ul>
        
          <li>
            <a href="https://coderq.com" target="_blank" title="码农圈">码农圈</a>
          </li>
        
          <li>
            <a href="http://zipperary.com/" target="_blank" title="Zippera&#39;s Blog">Zippera&#39;s Blog</a>
          </li>
        
          <li>
            <a href="http://hijiangtao.github.io/" target="_blank" title="Data.Blog">Data.Blog</a>
          </li>
        
    </ul>
</div>

  <div class="weiboshow">
  <p class="asidetitle">新浪微博</p>
    <iframe width="100%" height="119" class="share_self"  frameborder="0" scrolling="no" src="http://widget.weibo.com/weiboshow/index.php?language=&width=0&height=119&fansRow=2&ptype=1&speed=0&skin=9&isTitle=1&noborder=1&isWeibo=0&isFans=0&uid=2176287895&verifier=b3593ceb&dpc=1"></iframe>
</div>


  <div class="rsspart">
	<a href="/atom.xml" target="_blank" title="rss">RSS 订阅</a>
</div>

</aside>
</div>
    </div>
    <footer><div id="footer" >
	
	<div class="line">
		<span></span>
		<div class="author"></div>
	</div>
	
	
	<section class="info">
		<p> Hello,I&#39;m WuChong. For now I&#39;m a graduate student in Beijing. <br/>
			I&#39;ll share my learning experience with you at this blog.</p>
	</section>
	 
	<div class="social-font" class="clearfix">
		
		<a href="http://weibo.com/wuchong1014" target="_blank" class="icon-weibo" title="微博"></a>
		
		
		<a href="https://github.com/wuchong" target="_blank" class="icon-github" title="github"></a>
		
		
		
		<a href="https://twitter.com/jarkwu" target="_blank" class="icon-twitter" title="twitter"></a>
		
		
		
		
		
		
		<a href="https://plus.google.com/111190881341800841449?rel=author" target="_blank" class="icon-google_plus" title="Google+"></a>
		
		
	</div>
		<p class="copyright">Powered by <a href="http://zespia.tw/hexo/" target="_blank" title="hexo">hexo</a> and Theme by <a href="https://github.com/wuchong/jacman" target="_blank" title="Pacman">Jacman</a> © 2014 
		
		<a href="http://wuchong.me/about" target="_blank" title="WuChong">WuChong</a>
		
		</p>
</div>
</footer>
    <script src="/js/jquery-2.0.3.min.js"></script>
<script src="/js/jquery.imagesloaded.min.js"></script>
<script src="/js/gallery.js"></script>

<script type="text/javascript">
$(document).ready(function(){ 
  $('.navbar').click(function(){
    $('header nav').toggleClass('shownav');
  });
  var myWidth = 0;
  function getSize(){
    if( typeof( window.innerWidth ) == 'number' ) {
      myWidth = window.innerWidth;
    } else if( document.documentElement && document.documentElement.clientWidth) {
      myWidth = document.documentElement.clientWidth;
    };
  };
  var m = $('#main'),
      a = $('#asidepart'),
      c = $('.closeaside'),
      o = $('.openaside');
  $(window).resize(function(){
    getSize(); 
    if (myWidth >= 1024) {
      $('header nav').removeClass('shownav');
    }else
    {
      m.removeClass('moveMain');
      a.css('display', 'block').removeClass('fadeOut');
      o.css('display', 'none');
        
    }
  });
  c.click(function(){
    a.addClass('fadeOut').css('display', 'none');
    o.css('display', 'block').addClass('fadeIn');
    m.addClass('moveMain');
  });
  o.click(function(){
    o.css('display', 'none').removeClass('beforeFadeIn');
    a.css('display', 'block').removeClass('fadeOut').addClass('fadeIn');      
    m.removeClass('moveMain');
  });
  $(window).scroll(function(){
    o.css("top",Math.max(80,260-$(this).scrollTop()));
  });
});
</script>




<script type="text/javascript">
  var duoshuoQuery = {short_name:"wuchong"};
  (function() {
    var ds = document.createElement('script');
    ds.type = 'text/javascript';ds.async = true;
    ds.src = '//static.duoshuo.com/embed.js';
    ds.charset = 'UTF-8';
    (document.getElementsByTagName('head')[0] 
    || document.getElementsByTagName('body')[0]).appendChild(ds);
  })();
</script> 









<!-- Analytics Begin -->

<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-46321946-2', 'wuchong.me');  
ga('send', 'pageview');
</script>





<!-- Analytics End -->

<!-- Totop Begin -->

	<div id="totop">
	<a title="返回顶部"><img src="/img/scrollup.png"/></a>
	</div>
	<script src="/js/totop.js"></script>

<!-- Totop End -->

<!-- MathJax Begin -->
<!-- mathjax config similar to math.stackexchange -->


<!-- MathJax End -->

  </body>
 </html>
